<?
session_start();
if($_SESSION["memberId"] == null || $_SESSION["memberId"] == "")
{
	header("Location:../login.php");
}else{
	$memberId = $_SESSION["memberId"];
}

if(isset($_GET['tagId']) && is_numeric($_GET['tagId'])){
	$tagId = $_GET['tagId'];
}else{
	$err_messege .= "・該当するタグが存在しません。<br/>";	
	$err_messege .= "<input name=\"button\" type=\"button\" value=\"閉じる\" onclick=\"window.close();\" />";
	exit;
}


//$memberId = 1;
include_once("../Dao/db.php");

$sql = "select * from cvpoint where memberId = $memberId and id=$tagId";
$result = mysql_query($sql);
if(mysql_num_rows($result)==0){
	$err_messege .= "・該当するタグが存在しません。<br/>";	
	$err_messege .= "<input name=\"button\" type=\"button\" value=\"閉じる\" onclick=\"window.close();\" />";
	exit;
}

$row = mysql_fetch_array($result);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>タグ発行 > コンバージョンタグ</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script language="JavaScript" src="../js/common.js" type="text/javascript"></script>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#F4FFE4">
<span class="td9 top">※下記のタグを成果地点ページ、headタグの間に貼り付けてください。</span><br />
<table border="0" cellpadding="2" cellspacing="0" width="90%">
  <tbody>
    <tr>
      <td align="right">
        <input name="button" type="button" value="閉じる" onclick="window.close();" />
      </td>
    </tr>
  </tbody>
</table>
<div class="input_area">
  <table class="tbl" border="0" cellpadding="4" cellspacing="0" width="90%">
    <tbody>
      <tr>
        <td class="td9" align="left"><span class="required">成果地点名</span></td>
        <td class="td4 left"><?=$row['name']?></td>
      </tr>
      <tr>
        <td class="td9 top" align="left"><span class="required">URL</span></td>
        <td class="td4 border"><?=$row['url']?></td>
      </tr>
      <tr>
        <td class="td9 top" align="left">タグ<br />          </td>
        <td class="td4 border">
          <textarea name="tag_cv_http" rows="11" cols="100" readonly="readonly" class="txBox" align="left">&lt;SCRIPT TYPE="text/javascript"&gt;
var tg_domain = "http://<?=$_SERVER["SERVER_NAME"]?>";
var sales = <?=$row['salesValue']?>;
var cvId = <?=$row['id']?>;
&lt;/SCRIPT&gt;
&lt;SCRIPT TYPE="text/javascript" SRC="http://<?=$_SERVER["SERVER_NAME"]?>/listing/tracking/cv.js"&gt;&lt;/SCRIPT&gt;
&lt;NOSCRIPT&gt;
&lt;img src="http://<?=$_SERVER["SERVER_NAME"]?>/listing/tracking/cv.js" width="1" height="1"&gt;
&lt;/NOSCRIPT&gt;</textarea>
        </td>
      </tr>
    </tbody>
  </table>
</div>
</body>
</html>
